import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    children:[
      {
        path: '/',
        name: 'Index',
        component: () => import(/* webpackChunkName: "about" */ '../views/index.vue')
      },
      {
        path: '/about',
        name: 'About',
        component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
      },
      {
        path: '/cart',
        name: 'Cart',
        component: () => import(/* webpackChunkName: "about" */ '../views/cart.vue')
      },
      {
        path: '/qust',
        name: 'Qust',
        component: () => import(/* webpackChunkName: "about" */ '../views/qust.vue')
      },
      {
        path: '/user',
        name: 'User',
        component: () => import(/* webpackChunkName: "about" */ '../views/user.vue')
      }
    ]
  },
  {
    path: '/goods/:id',
    name: 'Goods',
    component: () => import(/* webpackChunkName: "about" */ '../views/goods.vue')
  },
  {
    path: '/delite/:id',
    name: 'Delite',
    component: () => import(/* webpackChunkName: "about" */ '../views/delite.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
